/*    */ package com.zimbra.cs.service.account;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.AccountConstants;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.cs.account.Account;
/*    */ import com.zimbra.cs.account.AuthToken;
/*    */ import com.zimbra.cs.account.AuthTokenException;
/*    */ import com.zimbra.cs.session.Session;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class EndSession
/*    */   extends AccountDocumentHandler
/*    */ {
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 38 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/* 39 */     if (zsc.hasSession()) {
/* 40 */       Session s = getSession(zsc);
/* 41 */       endSession(s);
/*    */     }
/* 43 */     boolean clearCookies = request.getAttributeBool("logoff", false);
/* 44 */     if ((clearCookies) || (getAuthenticatedAccount(zsc).isForceClearCookies())) {
/* 45 */       context.put("zimbra.invalidateCookies", Boolean.valueOf(true));
/*    */       try {
/* 47 */         zsc.getAuthToken().deRegister();
/*    */       } catch (AuthTokenException e) {
/* 49 */         throw ServiceException.FAILURE("Failed to de-register an auth token", e);
/*    */       }
/*    */     }
/* 52 */     Element response = zsc.createElement(AccountConstants.END_SESSION_RESPONSE);
/* 53 */     return response;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/account/EndSession.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */